<div>
<script>
  var item_id = "<%= params[:id] %>"
</script>

<h1 class="pagetitle">Editing <%= clean_text(@media.title) %></h1>
<%= error_messages_for 'media' %>
<div style="width: 600px; background: #f0f0ee; padding: 5px; border: solid 1px #ccc;">

<% form_tag :controller => '/media', :action => 'update', :id => params[:id] do %>

  <p><label for="media_title">Title:</label> <%= text_field 'media', 'title', :size => 50 %></p>

  <p>
    <label for="media_category_id">Category:</label>
    <%= select("media", "category_id", Category.find(:all).collect {|p| [ p.name, p.id ] }, {:include_blank => 'None'}, {:style => 'width: 300px;'}) %>
  </p>

  <p><label for="media_description">Description:</label><br />
  <%= text_area 'media', 'description', :style => 'width: 580px; padding: 5px', :id => params[:id].to_s+'_media_textarea', :onKeyUp => 'updatePreview(\'media\',\''+params[:id].to_s+'_media\');' -%></p>
  
  <p><label for="media_tag_list">Tags:</label> <%= text_field 'media', 'tag_list', :size => 50, :value => @media.tag_list.to_s %></p>

  <%= submit_tag "Update Media" %>
<% end %>
</div>
<h2>Preview</h2><img src="/images/spinner.gif" style="display: none; border: 0;" id="<%= params[:id].to_s %>_media_preview_spinner" /><div id="<%= params[:id].to_s %>_media_preview"></div>
</div>